package com.dh.cheesestrip;

import android.app.Application;

import com.dh.cheesestrip.Util.LogUtil;
import com.orm.SugarContext;

/**
 * Created by Mc on 2016/9/27.
 */

public class Config {

    public static String FRAMEWORK_NAME = "CheeseStrip";//框架名称版本
    public static boolean IS_DEBUG = true;//是否调试 true显示log信息
    public static String PACKAGE_NAME = "com.lex.cheeseStrip";
    public static final String SP_FILE_NAME = "sp";//sharePreferences名字

    private Config() {
    }

    private static class Ext {
        private static Application app;
        public Ext() {
        }
    }


    public static Application app() {
        if (Ext.app == null) {
            LogUtil.e("请在application中初始化config");
            return null;
        }
        return Ext.app;
    }

    /**
     * 调用框架初始化
     *
     * @param app 程序实例
     */
    public static void init(Application app) {
        if (Ext.app == null) {
            Ext.app = app;
        }
        SugarContext.init(app);//数据库ORM初始化
//        ImageUtil.init(app);//image工具初始化
    }

}
